#!/usr/bin/env python3
from gen_2 import sentences

# 将所有句子连接在一起，然后用空格分隔成多个单词
words = ' '.join(sentences).split()
# 构建词汇表，去除重复的词
word_list = list(set(words))
# 创建一个字典，将每个词映射到一个唯一的索引
word_to_idx = {word: idx for idx, word in enumerate(word_list)}
# 创建一个字典，将每个索引映射到对应的词
idx_to_word = {idx: word for idx, word in enumerate(word_list)}
voc_size = len(word_list) # 计算词汇表的大小
print(" 词汇表：", word_list) # 输出词汇表
print(" 词汇到索引的字典：", word_to_idx) # 输出词汇到索引的字典
print(" 索引到词汇的字典：", idx_to_word) # 输出索引到词汇的字典
print(" 词汇表大小：", voc_size) # 输出词汇表大小


# 生成 CBOW 训练数据
def create_cbow_dataset(sentences, window_size=1):
    data = []# 初始化数据
    for sentence in sentences:
        sentence = sentence.split()  # 将句子分割成单词列表
        for idx, word in enumerate(sentence):  # 遍历单词及其索引
            # 获取上下文词汇，将当前单词前后各 window_size 个单词作为周围词
            context_words = sentence[max(idx - window_size, 0):idx] \
                + sentence[idx + 1:min(idx + window_size + 1, len(sentence))]
            # 将当前单词与上下文词汇作为一组训练数据
            data.append((word, context_words))
    return data
# 使用函数创建 CBOW 训练数据
cbow_data = create_cbow_dataset(sentences, 2)
# 打印未编码的 CBOW 数据样例（前三个）
print("CBOW 数据样例（未编码）：", cbow_data[:3])


import torch # 导入 torch 库
def one_hot_encoding(word, word_to_idx):
    tensor = torch.zeros(len(word_to_idx)) # 创建一个长度与词汇表相同的全 0 张量
    tensor[word_to_idx[word]] = 1  # 将对应词的索引设为 1
    return tensor  # 返回生成的 One-Hot 向量
# 展示 One-Hot 编码前后的数据
word_example = word_list[0]
print("One-Hot 编码前的单词：", word_example)
print("One-Hot 编码后的向量：", one_hot_encoding(word_example, word_to_idx))
word_example = word_list[1]
print("One-Hot 编码前的单词：", word_example)
print("One-Hot 编码后的向量：", one_hot_encoding(word_example, word_to_idx))


# 定义 CBOW 模型
import torch.nn as nn # 导入 neural network
class CBOW(nn.Module):
    def __init__(self, voc_size, embedding_size):
        super(CBOW, self).__init__()
        # 从词汇表大小到嵌入大小的线性层（权重矩阵）
        self.input_to_hidden = nn.Linear(voc_size,
                                         embedding_size, bias=False)
        # 从嵌入大小到词汇表大小的线性层（权重矩阵）
        self.hidden_to_output = nn.Linear(embedding_size,
                                          voc_size, bias=False)
    def forward(self, X): # X: [num_context_words, voc_size]
        # 生成嵌入：[num_context_words, embedding_size]
        embeddings = self.input_to_hidden(X)
        # 计算隐藏层，求嵌入的均值：[embedding_size]
        hidden_layer = torch.mean(embeddings, dim=0)
        # 生成输出层：[1, voc_size]
        output_layer = self.hidden_to_output(hidden_layer.unsqueeze(0))
        return output_layer
embedding_size = 2 # 设定嵌入层的大小，这里选择 2 是为了方便展示
cbow_model = CBOW(voc_size,embedding_size)  # 实例化 CBOW 模型
print("CBOW 模型：", cbow_model)


# 训练 cbow 类
learning_rate = 0.001 # 设置学习速率
epochs = 20000 # 设置训练轮次
criterion = nn.CrossEntropyLoss()  # 定义交叉熵损失函数
import torch.optim as optim # 导入随机梯度下降优化器
optimizer = optim.SGD(cbow_model.parameters(), lr=learning_rate)
# 开始训练循环
loss_values = []  # 用于存储每轮的平均损失值
for epoch in range(epochs):
    loss_sum = 0 # 初始化损失值
    for target, context_words in cbow_data:
        # 将上下文词转换为 One-Hot 向量并堆叠
        X = torch.stack([one_hot_encoding(word, word_to_idx) for word in context_words]).float()
        # 将目标词转换为索引值
        y_true = torch.tensor([word_to_idx[target]], dtype=torch.long)
        y_pred = cbow_model(X)  # 计算预测值
        loss = criterion(y_pred, y_true)  # 计算损失
        loss_sum += loss.item() # 累积损失
        optimizer.zero_grad()  # 清空梯度
        loss.backward()  # 反向传播
        optimizer.step()  # 更新参数
    if (epoch+1) % 100 == 0: # 输出每 100 轮的损失，并记录损失
      print(f"Epoch: {epoch+1}, Loss: {loss_sum/len(cbow_data)}")
      loss_values.append(loss_sum / len(cbow_data))


# 绘制训练损失曲线
import matplotlib.pyplot as plt # 导入 matplotlib
# 绘制二维词向量图
plt.rcParams["font.family"]=['SimHei'] # 用来设定字体样式
plt.rcParams['font.sans-serif']=['SimHei'] # 用来设定无衬线字体样式
plt.rcParams['axes.unicode_minus']=False # 用来正常显示负号
plt.plot(range(1, epochs//100 + 1), loss_values) # 绘图
plt.title(' 训练损失曲线 ') # 图题
plt.xlabel(' 轮次 ') # X 轴 Label
plt.ylabel(' 损失 ') # Y 轴 Label
plt.show() # 显示图


# 输出 cbow 习得的词嵌入
print("CBOW 词嵌入：")
for word, idx in word_to_idx.items(): # 输出每个词的嵌入向量
    print(f"{word}: {cbow_model.input_to_hidden.weight[:,idx].detach().numpy()}")


fig, ax = plt.subplots()
for word, idx in word_to_idx.items():
    # 获取每个单词的嵌入向量
    vec = cbow_model.input_to_hidden.weight[:,idx].detach().numpy()
    ax.scatter(vec[0], vec[1]) # 在图中绘制嵌入向量的点
    ax.annotate(word, (vec[0], vec[1]), fontsize=12) # 点旁添加单词标签
plt.title(' 二维词嵌入 ') # 图题
plt.xlabel(' 向量维度 1') # X 轴 Label
plt.ylabel(' 向量维度 2') # Y 轴 Label
plt.show() # 显示图

'''
staff: [ 5.5709753 -5.789459 ]
garden: [-2.9967496   0.90651435]
soulful: [-4.0031157 10.859056 ]
they: [-0.7409051  1.9215779]
evening: [-4.5202684  6.530051 ]
moments: [-2.1938725  5.38863  ]
every: [ 0.56251633 -6.0483155 ]
blows: [-2.687453  -1.4711189]
goods: [-0.0041851   0.85454535]
symptoms: [-1.2988166  3.4530203]
photographer: [4.344915  0.3071125]
restaurant: [-1.0502237  0.6960637]
that: [2.1249259 2.5278757]
go: [-4.865842  2.131323]
voraciously: [1.515556  1.7381388]
writer: [ 4.26649    -0.36837474]
he: [-7.548851  -5.7543626]
explains: [ 7.9791517 -1.3649651]
trains: [2.6788716 1.8216062]
teacher: [5.1073422 0.5793938]
pens: [0.07556614 3.6369843 ]
reading: [-0.12951377  4.612262  ]
lesson: [2.8524177 1.8388057]
tracks: [ 5.2616544 -0.2197277]
trees: [ 3.1269388  -0.60869277]
loves: [ 6.961544 -5.818808]
guests: [3.1365745 1.0533297]
valley: [ 4.022898  -3.6284578]
mountain: [4.845086   0.30919725]
cat: [5.2319794  0.60595334]
fleeting: [-4.842605  5.305154]
manager: [3.269385   0.34761038]
purchases: [-0.71234375  4.932711  ]
assists: [0.7730865 2.8439953]
up: [6.145503  2.2367568]
rigorously: [ 4.2588687 -7.5416894]
just: [-4.118382    0.82673216]
summer: [-4.816366 -8.485536]
their: [-2.2514045  2.0578125]
awaits: [-0.67481124  0.7444836 ]
sets: [-7.024749 10.246757]
eagerly: [0.98645437 0.08166855]
train: [ 0.10170677 -0.82391703]
motivates: [5.3361964 2.842249 ]
lake: [ 3.9822435  -0.02846959]
upcoming: [3.4654562 1.6839485]
clearly: [16.568607  -3.9521313]
hiking: [-0.25624326 -4.0703883 ]
time: [-0.5481355 -7.7552013]
enjoy: [-0.69267976  4.1872416 ]
class: [  0.8065463 -15.073027 ]
nap: [-1.5206287 -6.3052487]
day: [ 1.9514611 -7.3015847]
serves: [ 5.038931   -0.81451225]
give: [-0.82277596 -4.7549567 ]
while: [11.809355  1.386614]
snow: [ 4.007443  -1.4510558]
skyline: [-1.4034188  1.8058949]
exam: [-1.9691857  4.0552306]
against: [1.9150734 2.58701  ]
precision: [ 0.83019775 -7.234432  ]
patient: [ 5.470711  -1.3255668]
magazines: [-1.8093158  2.5950704]
captivate: [-5.6423483  6.2323823]
horizon: [ 8.738877  -5.0832105]
carefully: [-5.0346684 -4.429154 ]
best: [-4.3120465  6.285563 ]
stands: [-2.6168644  6.8356557]
cooks: [-3.509125 11.672107]
camping: [-4.0852976  4.9422574]
tall: [-1.2753245  2.977328 ]
highway: [ 4.065472  -4.0215673]
walk: [ 0.4421527 -5.0545993]
behind: [0.9167163 4.0464773]
melts: [-3.0171237 -0.894229 ]
musician: [0.8848248 1.0353439]
by: [ 4.817197   -0.16315946]
picture: [-10.301499    1.6468889]
team: [ 5.886838  -6.1100125]
captivating: [-0.9477848  0.9394472]
often: [-7.0770464  6.342091 ]
glow: [-10.95014     1.3205832]
surgeon: [11.992466  -5.7872305]
tree: [ 3.3759964 -1.8696321]
with: [-3.9616406 13.5885   ]
sleeper: [-1.5045289  1.3297422]
breeze: [ 1.3117917  -0.23279929]
she: [-0.9533168  1.7294108]
sun: [ 5.417424   -0.91686887]
child: [2.136972  0.9472132]
diligently: [-1.1416754  -0.53465897]
examines: [3.538244  1.3458471]
doctor: [5.1671405  0.58959746]
as: [10.887257  5.831458]
performance: [0.01404824 2.5627933 ]
rain: [ 8.538978  -3.9105368]
wind: [ 1.7167648 -1.0822499]
slowly: [-0.89976937  3.078283  ]
during: [2.3671525 5.2802815]
all: [-5.2933497 10.137619 ]
for: [6.4363837  0.45796603]
peacefully: [-0.03506031 -2.618868  ]
effort: [ 7.4771366 -8.789974 ]
at: [ 6.8627605 -0.6930687]
baby: [5.1209126  0.25310412]
a: [-11.616606  11.126482]
operation: [ 6.358557 -3.977183]
over: [ 5.054583  -1.8862615]
playground: [ 3.243008   -0.14017692]
cries: [-6.3424535 -2.5564787]
wall: [ 1.721482 -7.037056]
paints: [-4.2832465 13.1926565]
employee: [ 4.1065793  -0.01028909]
buzzes: [-0.6198169 -3.0198033]
coach: [5.072742   0.58553064]
stories: [-0.94755566  3.8964193 ]
mountains: [ 3.8811471 -5.9266996]
smile: [-1.6441768  6.1244206]
brightly: [-0.4772631 -4.835837 ]
reads: [-4.41554    6.5190387]
towers: [-1.7419571  2.5218477]
and: [6.390875  1.3177474]
in: [11.32421     0.65889776]
on: [17.939314  4.698712]
moon: [5.1881824 0.5387193]
artist: [5.076389   0.52237064]
operations: [0.33363757 3.0110652 ]
alarm: [1.9862084 1.6996173]
free: [-3.8889778  8.21262  ]
laughs: [-3.5735397  0.6464235]
books: [-0.62655187 -4.0039396 ]
through: [6.185684  0.4663019]
falls: [1.6495004 7.2888303]
student: [3.359204  1.6415787]
dog: [ 2.2653072 -1.5000787]
its: [ 0.49231967 -5.4483438 ]
nursery: [ 2.6727438 -5.6648374]
kitchen: [ 8.159606  -6.5148215]
gentle: [-3.333328  9.592454]
steadily: [-9.211395  1.647635]
chef: [5.055472   0.50220644]
nurse: [-7.395432  -3.0729227]
speeds: [-3.631912   8.6402025]
chugs: [-4.012469  8.077979]
wake: [ 5.7407007 -7.95572  ]
her: [-4.974153 -4.197524]
building: [ 1.9355044 -2.547323 ]
sways: [-2.6043997  5.1271887]
captures: [-0.8222336  1.8032907]
store: [ 4.1395526 -1.0791618]
joyfully: [-3.3094082  7.9995995]
ticks: [2.3748538 7.773888 ]
meet: [ 5.64697  -9.277344]
gently: [-0.69472563 -4.6157017 ]
casts: [-3.011839 12.380368]
clock: [ 9.522495  -4.2761493]
read: [ 6.2963786 -5.2039285]
blooms: [-2.2864091  5.1150484]
night: [-5.9940867  1.2795558]
landscape: [-3.8433344 -2.9721007]
we: [-9.77211    -0.38655993]
from: [4.315879  1.4036031]
readers: [ 1.3229854 -7.447848 ]
studies: [-5.583558 14.883815]
flower: [4.911332   0.01478174]
to: [ 6.8840413 16.73595  ]
meal: [-1.7891034 -5.670909 ]
plays: [-2.6342814 11.385261 ]
works: [-5.001964  8.00724 ]
buyer: [ 2.4200642 -1.5892327]
river: [4.538981   0.04993481]
reader: [0.49575832 1.9014353 ]
along: [ 2.8105292  -0.02398816]
devouring: [5.6938877 2.6965792]
prefers: [  1.1425445 -10.698811 ]
smooth: [ 0.08541402 -6.445537  ]
the: [-13.446049 -11.466359]
flows: [-3.6937146  6.913265 ]
vibrant: [-1.5926788  8.0869055]
roof: [-3.926025    0.03717405]
heavy: [ 2.8007321 -2.4268062]
car: [4.5652127  0.19702846]
down: [3.2930598 3.698448 ]
improve: [ 0.82232636 -3.9046082 ]
athlete: [1.9364872  0.30128342]
melody: [-10.539029    1.5087683]
supervises: [5.8005414 2.6359704]
guitar: [ 1.1126724  -0.37783292]
softly: [-0.9054545 -4.2500095]
city: [2.5768993 0.9681979]
enjoys: [1.398564 7.59241 ]
delicious: [-1.677105  7.082471]
'''
'''
summer: [-0.22534657 -0.1898295  -0.4260183  -1.0714694  -0.20493905 -0.6309483  1.9397002  -1.2503597   1.0631417   1.2492846 ]
melody: [ 2.4967377   0.7397888  -1.1075788   0.40383974  0.14625686  1.8311129  1.8987832   2.2452323   1.5711671   0.5798245 ]
nap: [ 1.0985882  -0.50619555 -0.93588424 -2.5788205   1.0247419  -1.2589176 -0.22204784  1.2494174   1.2846942  -1.355456  ]
cries: [-1.2818005 -1.990298   0.3424329 -1.6228528  0.54918    0.3856338 -3.8119242  1.5239135  1.1569839 -1.1006225]
delicious: [ 0.872134   -1.7716929   0.31902453  0.91211087 -0.1353034   0.37452292 -2.015699   -1.4536961  -1.1891513   1.8451163 ]
buzzes: [ 1.4016551   0.3230383   1.251642   -2.2469034   1.2677591  -1.9729125  0.55983907  0.38611117 -2.3549693  -1.5526375 ]
precision: [-2.356783    1.5608025   1.3383869   1.5158107   0.2978306  -0.34787947  1.7944045  -0.6782216  -0.26168105  0.12976271]
writer: [ 0.58727074  1.3754566  -0.24003187  1.1360905  -0.9579165  -0.19766417  0.80187345  0.34127957 -1.4221241  -1.6594721 ]
from: [-0.70594853  0.31476295  1.1514065  -1.4797434  -0.07253926  0.23649983 -0.3257084  -0.6453546  -0.4229162  -0.9524688 ]
river: [-1.6236414   2.134413   -0.34663486 -0.9344774  -0.4037794   0.849749 -0.32386693 -0.2631445   0.25832078  0.2784463 ]
evening: [ 2.9668663   1.5534483   0.0825929  -1.4859318   0.08574449 -0.83867496 -2.3768718   0.80200684 -2.0537128   0.6118794 ]
all: [-0.9387065   0.11325777 -0.431177   -2.558927   -0.43968263 -1.9244217 -0.24522954  1.5401515   1.9560804   3.0966086 ]
prefers: [-0.20587388  0.5771567   0.89875895 -0.96365774  1.6103811  -2.7119803 -0.7244167   0.96988744 -1.8959237  -0.16483316]
they: [ 0.3808183   0.23235554 -0.5813895  -0.35686794  1.2790474   1.3760823 -1.4888346   0.4574867   0.3240838   0.20239447]
plays: [ 0.6172629  -0.99212646  2.3652093   0.89864457  0.3890854   1.9772462 -1.2482295   0.85457534 -1.2701101   3.0223033 ]
every: [-9.5380497e-01  1.1239065e+00  1.8125305e+00 -1.6772859e+00  1.3156766e+00  2.5000749e+00 -1.7444197e-03  8.7871844e-01
  9.8680454e-01 -2.9003272e+00]goods: [ 3.09717     0.7463746   1.0764685   2.8609536  -0.3240298  -1.6095206 -0.28628898 -0.8969486   0.4499992  -1.7032291 ]
highway: [-1.742171    1.0007093   0.0859453   0.57942945 -0.88200605 -0.02480995  1.8145173  -1.049279   -0.5215645  -1.0286348 ]
effort: [ 1.0274352  -1.3141164  -2.3428166  -0.32227328 -0.17894037 -1.7962589  0.04342486 -2.3523731  -1.8571572  -1.5461159 ]
hiking: [ 1.6916418  -1.3108361  -0.77413493 -1.6017785   1.2735206  -0.51231295 -1.4674481   0.9655424   1.8654158  -1.5561665 ]
wall: [-1.526554    0.6867447   0.301803    0.7189485  -0.617104   -0.31614333  1.8033171  -0.73225856 -0.43841717 -0.7926597 ]
through: [-1.2164667   0.38953924 -0.9873895  -0.8812219  -2.2906365   0.32591137 -1.7010087   0.54222244 -0.8193717  -1.4292513 ]
flower: [-1.4784071   0.24823776 -0.5817783  -0.94354033 -0.6693039   1.3211493 -0.04614839 -0.883322   -0.1876842  -0.96525955]
manager: [-0.6887441  -0.8124998   0.72462296 -1.7864162   0.31236273  1.9095526  1.0938201  -1.4656142  -1.6045101  -2.1869388 ]
softly: [ 1.6876761   1.6287909  -3.186323   -1.2243931   0.38244292 -1.7466583 -1.1427137   2.3664732   0.00926667 -1.2826138 ]
walk: [-1.0722828   0.14292817  1.0954515  -1.2472229   0.6437565   1.7424242  0.3649993   0.651596    0.552742   -0.6837619 ]
child: [-0.99146557 -0.16563675 -0.48105234  0.44387764 -0.44243968 -0.5921004 -1.2343303  -1.1102737  -0.7215573   0.08339904]
cooks: [-0.12335324 -1.8303016   1.0832293   2.008675    0.5169557   2.5909703 -1.529374    1.6651726  -0.79443514  0.13760744]
city: [-0.69721305  0.50087976  2.1957748   0.85887724  0.22436437 -0.80252343 -0.60539025 -0.55426025 -0.799076   -2.5521567 ]
laughs: [ 2.177547   -2.594541   -1.7980198   1.6682086  -0.87830764  1.5073209 -0.49145424 -1.4429897  -0.4498289  -1.4208367 ]
falls: [-0.4094102  -0.78725874  2.6762464  -1.311613    0.4735551  -0.6148564  0.47321174 -2.0123425  -2.7360115   1.7579219 ]
wake: [ 1.0359722e+00  2.4902564e-01  1.4384735e+00 -7.9014200e-01 -3.0742486e-03 -3.7205617e+00 -7.9763241e-02 -7.6687962e-01
 -1.4429023e+00  1.0194556e+00]trees: [-0.39440238  0.46646887 -0.21682684 -0.04727608 -0.4466196   0.3071663  0.46964368 -0.47539145 -0.14769621 -0.55218565]
building: [-0.4361796   1.1630137   0.33125842  1.7585481  -0.48878723  1.3056537 -0.39270484  0.8384204  -1.0223048   0.9125814 ]
rigorously: [-0.33076686 -0.28802127 -0.02165957 -3.080789    0.77887994 -1.1855059 -1.0037526   1.3659956  -0.89837724 -0.27484515]
staff: [-0.6709911   1.1754278   0.27353835 -1.1808746   0.09201291 -1.6859463  0.5337039  -0.04052677 -0.8661802  -0.8870924 ]
works: [ 2.0390813   3.6762557   2.312843    0.9526167   0.18004718 -1.6579864 -0.6463072  -0.57437813 -0.12329758  0.15225388]
stories: [ 1.8405174  -1.3399152  -0.5707819  -0.8793408  -1.1911421  -0.3441282 -1.6419684   0.29578125  1.1064326   0.8250333 ]
stands: [-1.3218603 -1.2427518  0.7141215  1.804495  -1.1897931 -1.1818846 -2.2584198 -2.8220034  1.0418708  1.528612 ]
patient: [-0.88700575  0.9197113  -0.26089215  1.0032864  -0.5487433   1.149632 -0.55405116 -1.089582    0.83498716  1.0804635 ]
purchases: [ 0.8598055  -1.8426989   2.9713004  -3.1923277   1.4607348   0.46459752 -1.4234889  -0.3092909  -0.14896554 -0.6837899 ]
their: [ 0.5857136  -1.2291011  -0.36774543  0.19836406  0.79437923 -1.870987 -2.8073018  -1.2324705   0.5458666  -1.2838216 ]
melts: [ 2.2649267  -2.9750886   0.1230484  -1.0932229  -2.313842   -1.082422 -0.40995234  1.3069609  -1.4249686  -1.9273833 ]
garden: [ 0.34804103  0.49403593 -2.3946998  -1.983342   -0.996028    1.0000727  1.4045295  -1.0274003   0.44570193  0.92422986]
the: [-0.8018119  -2.7597907  -0.94159293  2.094616    6.4200726  -1.1400348  4.677989   -0.13778447  1.7559149   1.5913802 ]
studies: [ 2.1513207   1.6879363   1.4607496   0.0882642  -0.1555243  -2.3154292 -2.624634   -0.35357738  0.4160556   2.441723  ]
tree: [ 0.5524294   1.831364   -1.0988253  -0.6052426  -0.65984315  1.6846613  0.5392477  -0.2971798  -1.0875785  -0.33894536]
examines: [-0.7713215  -0.06476043 -1.65068     1.3715189  -1.4989449   3.2294817  0.8467909  -0.02448636  0.10806242 -0.6689187 ]
photographer: [-0.2282941   2.1362052   0.49057314  0.15125218 -0.4205857   0.9771485 -0.7116295  -0.7652355  -0.8518705   0.05782054]
often: [ 2.3670895   0.12062381  0.98217404  1.9534956   0.5276851  -1.6308854 -1.7146109   1.7159793   0.4410507   0.4967586 ]
moon: [-0.41885346  0.1835548   0.6733725  -0.91443235 -2.2853935   0.60770804  1.8982011  -0.9138411  -1.1999559   0.5001294 ]
diligently: [-0.00972258 -1.0208901   0.56010634 -0.21558422 -1.6652908  -5.037899 -1.8683118  -0.01321351  0.2674432  -1.2102075 ]
for: [ 0.01298984  1.756478    0.98346776  0.20868033 -1.8158654  -0.26898032  0.04513062 -1.3245783  -0.30365774 -0.63175315]
valley: [-1.6294224   0.7731988   0.18643004  0.7203241  -0.5989886  -0.22011885  1.7902162  -0.69926775 -0.3867309  -0.8513244 ]
team: [-0.4761898   1.062066    0.12891324 -1.018938   -0.06988116 -1.2230084  0.4612292  -0.05690545 -0.6949791  -0.5830287 ]
time: [-1.2510413  -0.21284193 -0.55770665  0.47878695 -0.49847212 -1.738677  1.2141125  -0.9916891   1.1459169  -0.06745404]
over: [-0.6168315   1.5952423  -0.01118497  1.4942424  -0.8638609   1.5829759 -0.04720236  0.6084709  -1.2372782   0.29146245]
train: [-0.9843598  -1.1834148   1.3909594  -0.9421992  -0.7710428  -0.06219069 -0.27267346 -0.5790698  -0.9920762  -0.6987157 ]
tall: [-0.19483486 -0.90948737 -1.7485523  -1.0477736   0.84566563 -1.0529348 -2.4584675  -2.6566496  -2.071957    1.2872365 ]
gentle: [ 2.4098907  -1.0148677  -0.01424275  0.42980942  0.8660984   0.01848738 -1.673281   -1.166206   -1.8089781   1.5481293 ]
clock: [-1.5392673   2.0409591  -0.01788708  0.05863219 -0.6022412   0.14586921 -0.41922215 -0.33959818  0.64120793  0.22308666]
operation: [-1.040626    1.0959018  -0.55952275  0.04901098 -1.066885    0.6373483  1.0390252  -1.2109325  -0.45730546 -1.2112747 ]
teacher: [ 1.529383    2.9861248  -0.11358108  0.72404456 -1.0973098   0.0895111  1.6070161  -1.2557567   1.0334331  -0.72475594]
a: [ 0.11823723  0.6113796   2.1580317  -1.1200982  -3.0215304   1.6335276 -1.1268661   5.962579    0.19373716  0.12629718]
awaits: [ 1.0584956   0.89595234 -0.66168547  1.5304357   1.3548703   0.9062238 -0.74588853  2.1743917  -2.1941588   0.4457457 ]
employee: [-0.37821057  0.8684009  -0.7097332   0.36707723 -1.0183791  -0.28694487 -0.5394572  -1.3205295   0.9194861  -2.0981383 ]
pens: [ 3.007851   -2.8854115   0.4250916   0.5890425  -0.60267866  1.6292574 -1.1184399   1.2821026   0.47752464  0.62446904]
speeds: [-0.5727209   0.8978624  -3.724719    1.8830738   0.15013681  0.598933 -2.1094658   0.27882558 -0.49998203  1.4301482 ]
sways: [ 1.2282716   1.9948894   1.6344631   0.46173555  1.5433171  -0.09673887 -2.8627162  -1.2126555   3.264205    0.32886133]
nurse: [ 1.1468681   1.3549047  -0.8909525  -2.6243525   1.6866117   0.39650482  1.4144125  -1.3707238   0.13994491 -0.3764277 ]
lesson: [ 0.43290746 -0.21868184  0.12491515  1.2572727  -0.58587444  1.789706  0.7353393  -1.2788131  -1.2596829  -1.9438251 ]
eagerly: [-0.38283512  1.9564406   2.5950925  -0.81358063  0.17677486 -0.72356004 -1.3230824   1.1740496   2.6511273  -1.3562913 ]
with: [ 1.982995  -1.7216073  0.6662178 -1.2151861  1.7038387  1.309162 -2.8590977 -0.9859846 -1.0656759  2.0418825]
soulful: [ 1.3343602  -1.7542605   1.0426515  -0.57880485  0.35197034  0.91733843 -1.397747   -1.470987    0.17000896 -0.20423076]
smooth: [ 1.2932858  -0.24291027  1.3300244  -2.5212142  -0.5996157  -0.8321246 -0.71844536  0.06952329  0.37971827  1.752567  ]
symptoms: [-1.2730260e-03 -9.2867136e-01  1.7865810e+00  1.6742307e-01  2.2518398e-02 -1.6553873e+00 -3.7683025e-02  3.2601867e+00 -3.1295948e+00  2.1403028e-01]
chugs: [-0.4711224  -1.4786547   0.47604135 -0.92537004 -2.0121777   0.6595108  1.0371292  -0.2420585  -1.3016124   3.8416214 ]
exam: [-2.2753117   0.28189093 -1.2590915  -1.0651225   0.7286098  -1.4615812 -1.6938194  -0.543505    1.6648725  -1.0936902 ]
loves: [-0.9710906   0.24705729  0.86414814 -2.1405988   1.7819573  -2.751453 -1.6960322   0.8782184  -0.18072848 -1.2108788 ]
car: [-0.86066604  0.04681168 -0.666161    1.2193849  -0.5572573  -0.29990086 -0.773633   -1.135056   -0.81770295 -2.208205  ]
dog: [-0.2035801   1.2471708  -0.24352024  0.98320967  0.19902816  0.1521293  0.41419092  0.89470863 -1.8755819   0.28245464]
enjoy: [ 1.1974806  -1.8872819  -0.49494776 -2.9141617   0.05386281  0.08144019 -0.02234217 -1.1792691  -1.4015584   0.39425656]
athlete: [-0.41143206 -0.26333782 -0.9142205  -1.5401909  -0.17348944  1.3757943 -0.8419837   0.3932269  -0.4844943  -0.5582418 ]
camping: [ 0.6532511  -1.9788289  -1.5552387  -0.47233203 -0.18097462  0.3424869 -1.0059868   2.1422205  -3.0383332   1.6341151 ]
at: [ 1.7403659  -0.0867965  -1.091189    0.08776612 -2.6710167  -1.4907174  1.2090048   0.4839138   1.0274495  -3.7562165 ]
musician: [-1.9261106   0.8620551  -0.62988967  1.1540778  -1.48535    -1.2762952 -0.35245866  0.72566164 -0.1095699  -0.56792533]
slowly: [ 2.148125   -0.55746573  0.5869715   0.8736831  -0.13884169  0.7905771  0.06916979 -0.4215238  -0.8183775  -0.5609207 ]
down: [-0.14011799 -0.81389576 -0.2606846   1.2663635   0.07513341 -0.76305926 -1.687621   -0.30808565 -0.45531887 -1.6039761 ]
magazines: [-0.46836963  0.13240613 -0.19360861  1.5725527  -0.2623336   1.392796 -0.9505479   0.86720693  0.8405053   1.7712995 ]
free: [ 2.508783    1.3774475   0.05429234 -1.0086793   1.4722738   0.8748237 -1.7757375   1.3743614   1.1596521  -0.7109556 ]
trains: [-0.05085976 -2.5952406   0.8765072   3.2291687  -0.37297195 -1.2770556 -2.0225568  -0.30666995 -2.2628171  -0.5354698 ]
go: [ 0.29926518 -0.9238724  -2.0315475   0.04662197  0.9936684   1.9696681 -1.6481816   1.332578   -0.40713707  0.665608  ]
flows: [-0.16976596 -0.22779672 -0.536035    2.0132494   0.11812096 -1.2495787 -3.035458    3.0062528  -2.3213146  -0.1224927 ]
improve: [ 0.64864534  2.4263504   0.08962334  0.08883598  1.2866204  -1.3190243 -2.1292124  -0.49511975 -0.09583858 -0.956168  ]
sets: [-1.9232452  -0.5769714  -1.2112292  -1.3552445  -1.0743026  -1.1102248 -0.60597867  2.4437232   0.6193362   2.8979368 ]
class: [-2.2153192   1.7351617  -0.4114665   0.48923174 -1.0832746   0.44644445  2.2323847  -1.5229865  -0.73225963 -1.5909345 ]
along: [-1.1838224  -0.9623355   1.3419352  -1.0740383  -0.8384051   0.01588534 -0.3573326  -0.6710464  -1.1186361  -0.7992083 ]
surgeon: [-0.86634934  1.2646722   0.19422147 -1.9083534  -2.1688545   0.16576356  1.5024122  -2.9491134   0.69844687  0.2756688 ]
captures: [ 1.6740395  -0.5407806   3.3252888   0.23856871  0.8639752   2.081505 -0.59738296 -1.7224667   0.09004568 -1.0771712 ]
store: [-0.5936515   0.7174876  -0.1861325   0.06784739 -0.5154661   0.39388055  0.5299795  -0.6279176  -0.28965238 -0.578093  ]
picture: [ 1.9979796   0.24420957 -2.7119641   1.0596099  -1.1633174  -0.03286254  0.52749646  2.4501646   0.6458275   1.4381711 ]
brightly: [ 0.16508044 -1.2422171  -1.6415949  -2.4788172   0.56863505  0.84580296 -0.769291    0.566818    1.8051317  -1.5779557 ]
night: [-1.1755031  -2.2167416  -0.23115364 -0.88337827 -0.15886977  1.1320342  1.2602464   1.9037479  -0.166952   -0.13919495]
guitar: [-0.3374667   0.39770004 -0.21512926  0.00864945 -0.33727518  0.3150186  0.27749908 -0.3500974  -0.10053391 -0.44059318]
captivate: [ 1.4977139  -1.6768054  -0.8811001  -2.1180096  -0.37108764 -0.23798774 -1.9602007  -0.88342786  1.473961    0.8419763 ]
landscape: [-1.0097339  -1.4797215  -1.1851496  -0.278      -0.26803553  0.48844427  0.83586514  0.32318395 -0.5997936  -0.9092526 ]
snow: [ 1.3984491   0.23668624  0.20203173  0.8833156  -0.8178535   1.245161  0.65817785 -1.2900426  -1.1551565  -1.3629942 ]
ticks: [-0.01575166  1.2255739   1.5212239  -2.3010154   1.2298316  -0.10924298 -0.4111846  -0.14198393 -0.29864228  3.2636034 ]
just: [ 1.6169295   0.28698203 -1.8493856  -2.7696161  -1.3619708   0.09349527  1.6573783  -0.42193446  0.3610907   0.8837122 ]
paints: [ 0.8955898  -0.40705213  0.15320486  1.9473045   0.6821833   2.3311462 -1.8240353  -2.0376055  -1.7403338   2.346818  ]
breeze: [-0.33285114  0.3230503  -0.1438474  -0.00380872 -0.36174944  0.15675296  0.23250763 -0.2972682  -0.1240659  -0.34874666]
day: [-2.0523236  -1.1027328   0.6959467   2.2828038  -0.56034    -0.9035856  0.79283607  0.8286002  -0.37623605 -0.68308717]
clearly: [-1.1872028   2.4848166   0.56975955 -2.4920325   0.56318206 -3.404871 -1.4027283   1.3716221  -2.0096662   0.9578068 ]
voraciously: [ 1.1239145  -1.2744205  -0.08302739 -0.7851818  -1.9361933   2.3919797 -0.32020545  0.26750043 -1.3252963   0.10607965]
upcoming: [-0.402487   -1.3397053   0.70530903  1.291214   -0.9841638   1.7171686 -0.49937928  0.3198942  -2.0780547  -1.182584  ]
best: [ 0.96993697 -1.1260734   0.66085935 -0.34451193 -0.31054178 -0.35375896 -2.9353914   0.8236238  -1.3132695  -1.0445564 ]
reads: [-2.066195    1.6529936  -0.05745775  1.8117255   0.5669693  -1.2322278 -1.8114724   0.6452853   2.8765397   1.1635138 ]
skyline: [ 1.7887064  -1.250778    1.385632    1.3051814   0.6941854  -0.5718858 -0.9689436  -0.02495425  0.85778403 -2.6271646 ]
glow: [ 1.8249843   1.861914   -0.14215274  0.99574554 -1.471874   -1.1436309  1.5596606   1.8791119   2.002199    1.768943  ]
carefully: [-0.2839843   0.30140018 -1.4764479   0.11907053 -0.14486225  1.0948837  0.28404355 -0.9276443   1.5557661   2.3227956 ]
coach: [-0.9225486  -0.05857161 -0.79821706 -0.34359694 -0.07400637  0.24642256 -0.8767464  -3.6987543   0.8731411  -1.7719904 ]
during: [-2.710274    1.6875293   3.141939    0.26283666  1.4463946   0.20405254 -1.9353918  -0.693861   -2.0226395   1.3696817 ]
captivating: [ 1.8060744   0.9675802   0.02640369  1.7278926   0.40580425 -0.11540996 -1.2450936   1.5249423  -0.4534106  -2.1014633 ]
and: [ 0.5254575   1.4307114   0.10749542 -0.93570197  0.17629372  1.2553099 -0.48813447  0.3834309  -1.6531494  -4.8678536 ]
sun: [-1.10444     0.2333777  -1.235536    2.9402003  -1.5298227   0.42637873 -1.444706    0.5078167   0.20883743 -0.9893788 ]
to: [ 1.8425593  -1.6907563   5.511513    1.6025381  -5.871785    0.27272603 -1.4790206  -1.1622534   2.21309     0.44333076]
blows: [-2.2846847  -2.0655699   1.3253909  -0.55336154 -1.7675211  -0.30128047 -2.252198    1.5156816   1.8137248  -0.22511518]
as: [ 1.2548076   2.9500005   2.4515584  -2.2943206   0.30328622  3.5590634  2.102886    1.0428741  -3.9356265  -0.60850465]
supervises: [-1.8907423   0.16152401 -0.88513374 -1.9055337  -0.55825645  2.6880178  1.172778    0.89528704 -0.27801397 -1.1042643 ]
playground: [-0.63697696  0.7603081  -0.19750091  0.0301692  -0.60429853  0.38443103  0.54700387 -0.68778753 -0.27778086 -0.6129007 ]
student: [ 0.15801321 -0.6582901  -0.10606982  0.8529414  -1.753229   -0.7401458  0.3270888   0.03623831 -1.1822819   0.06832607]
guests: [ 0.60878867  1.9539673   1.2962778   1.1362386  -0.4501215   0.04406078 -1.2845764  -0.5580706   0.48143938 -0.99413186]
up: [-1.9213262   0.52181804  0.4953753  -1.3583038  -1.743652   -0.379853  0.9845556  -1.2972828  -1.6857902  -0.83713514]
blooms: [ 2.5549846  -1.4464518   0.85241365 -1.9922869  -1.9897131  -2.5515525  0.04317561 -0.23716576  1.8802909   0.54753584]
behind: [ 0.04071527  1.1030349  -0.8890104   1.6063694  -0.5966313   0.21081655 -1.0987248   0.09453861  0.6247325   0.00404063]
nursery: [-1.5580647   0.67908305  0.21953966  0.73091006 -0.56828296 -0.277933  1.8659732  -0.66501147 -0.4345186  -0.7548202 ]
meet: [-0.3083737   1.0111972   0.35144028 -1.2176671   0.22310048 -1.2165571  0.3423507   0.17416246 -0.66463596 -0.42836815]
cat: [-0.76493186  0.86830807 -0.7736291  -1.1079766  -1.4864513   1.432864  1.1306322  -1.5153272   0.8862391   0.5473233 ]
wind: [ 0.5296715   0.30791518 -1.1307114   0.45016813 -0.656585   -0.7186294 -0.22294657  0.85201806 -0.09232563 -0.987512  ]
moments: [-0.46135992 -1.1240456   1.9894574   0.5254209   1.0522305   0.6802759 -1.99967    -0.6871236  -0.16321138  0.8215448 ]
joyfully: [-2.1345623  -3.1953769  -1.971362   -0.67790514 -1.2859558   0.5357292 -0.9268309   0.4123681  -1.8009762  -1.1194099 ]
roof: [ 0.31787327  0.56312186 -2.4275413  -1.8921248  -0.97730124  1.0526178  1.483924   -1.0212228   0.38368896  0.9395763 ]
mountain: [-0.40218607  0.6786703  -1.0521541  -0.5026121  -0.82883924 -0.22911197 -0.2364067  -1.9449726  -1.0553105   0.14434767]
reader: [ 0.7683316   0.1929472  -0.11634792 -0.49889067 -1.6872776   1.260489 -0.0885629  -0.46476385 -0.92758304  0.6182798 ]
baby: [-1.0538077   2.1730406  -0.72602177  0.18228649 -1.6756846  -0.2546014  0.37433395 -0.56731665 -1.2556926   0.12613791]
chef: [-1.6498343   1.9552535  -1.1616889  -0.83507055 -0.7664016   2.0033224  0.27165776 -0.48222065  0.8975442  -0.24118617]
explains: [-2.4150186   0.28703475 -1.239608    0.7396738   1.0257927   0.8441609 -1.4369774  -0.43376425 -2.0092587  -1.8469471 ]
against: [-1.3043907  -0.4649692   0.12457611  0.7420694  -0.94143534 -0.31074128 -0.39090425 -1.4807628  -0.52350694 -0.06905089]
by: [-0.38697466 -0.57584435 -0.67532164 -1.7075647  -0.6778619  -0.08036461  0.22621053 -1.175298   -0.8193538  -0.6060098 ]
heavy: [ 0.09317539 -1.1959971  -0.9324168   0.8598728  -2.6063008  -0.7563398  0.6321428  -0.00684065 -1.3272232   0.59006906]
horizon: [ 0.861767    0.46200532 -1.8140526  -0.8661267  -1.4536934  -0.9667784  0.6287319  -2.4393013  -2.663806   -1.7002982 ]
restaurant: [ 0.83496094 -0.02896185  0.95531267 -0.49619135 -0.18003581 -0.27378756  0.6899192   1.3709728  -1.1746757  -0.7248935 ]
fleeting: [-0.259707    2.397149    1.8827195   0.95952123  1.1818122   0.54464734 -1.4965923  -0.01056157 -0.50966996  1.7297974 ]
casts: [ 2.8632019  -1.0686191  -0.56768835  0.67395824 -0.18905538 -0.34325498 -1.4951544  -2.3715837  -0.26352182  2.0759637 ]
she: [ 0.03507341  0.23885399  0.8302691  -0.28587946  0.965481    0.45572695 -1.2786592  -0.49201968  0.76578987  0.78623414]
towers: [ 1.2501417   3.293228    0.03916014  1.6779096   0.3341316   0.91536814 -0.10341023 -0.30373025 -0.8338248   3.0575106 ]
doctor: [-0.6610187   2.0990427  -1.633529    1.1269277   0.20674172  2.0266976 -0.01562419 -1.8048908   0.45662042 -2.1531312 ]
tracks: [-0.7163421   0.74910665 -0.34624532 -0.0341907  -0.59840494  0.49076876  0.55458665 -0.6832973  -0.25503978 -0.76391655]
enjoys: [ 2.4166677   1.1433647   0.51730216  0.3806934   0.7424061   1.5964243 -1.3726523  -1.3964432   1.6964872  -0.74497545]
read: [-1.029441   -0.84134877  1.3819406   0.17332904 -0.61138123 -2.2253213 -1.3766642   1.3479131   0.9939821   0.8709377 ]
gently: [ 2.2101336  -0.00674664 -1.8710957  -2.0851524   0.7721607   1.1489291 -0.5018608   1.3159461   0.87718934 -1.0066288 ]
meal: [ 1.1603601  -0.93120843 -1.2057304  -1.950792    0.74906576 -0.31106722 -0.7334666   1.3765981   2.0326562  -1.977685  ]
books: [ 1.4181167  -2.299849   -0.8656488  -0.07138387  0.05152     2.4125853  0.44610214  0.6483607   1.710344   -1.3263216 ]
he: [-1.3467019  -0.9594753   0.39222875  1.5610018  -0.36438408 -1.9597149  2.3277993   0.19012628 -0.5044333   0.05581261]
peacefully: [ 0.37836155  3.0566947  -1.6800561  -1.4106768   1.5381958  -0.19513586 -1.318664    1.9646916  -0.01806303  0.66645914]
smile: [ 0.636538   -0.8727616   0.45460764  0.20346193  0.11909306  0.40736952 -0.9400286  -0.24332136 -0.741804    0.91189307]
while: [-3.836655    1.9498764  -0.22110322 -3.5570621   1.4705662   3.841345 -2.5664043  -3.7515953  -2.3937984  -0.22398452]
lake: [-0.46650013  0.66597325 -0.26324904 -0.04330336 -0.56368625  0.2949485  0.5252073  -0.48745725 -0.21756482 -0.57383746]
her: [ 0.32395926 -0.7854965  -1.9062505  -1.3741733   0.1625422  -1.301712  0.00660499 -0.39635864  2.4169285  -0.72723454]
steadily: [ 1.1520582   1.5987029  -2.0962296   1.5748688  -2.0723717  -0.81183606  0.3459838   2.3398001   2.6116614   0.8207623 ]
reading: [-1.315271    0.902136    1.0683401   0.32726398  2.1120856   1.2298968 -2.6120865   0.5562828   0.29947203  2.5332394 ]
on: [ 0.69095254  2.574752    2.4407003  -1.0304769  -0.40034118  1.0684686  1.2407243  -3.9350019  -0.4382332   1.0448475 ]
readers: [-2.67157     0.04843832 -0.8148554   1.2927854  -0.61300224 -1.9283047  0.7658616  -0.38908067  0.18278593 -0.58101064]
serves: [-6.1042804e-01  7.3004371e-01 -3.3354506e-01 -1.4286794e-04 -6.4570099e-01  4.0418869e-01  6.8885058e-01 -6.9665569e-01 -2.7731767e-01 -7.3296726e-01]
assists: [ 1.1922632   1.5177699   0.14599553 -0.80057955  0.25172755  0.40283158 -0.50015384  0.36718798  0.67821354 -0.2709278 ]
rain: [ 0.09193943 -0.06893394 -1.1028463   0.4811386  -1.8520045  -0.13573104  0.36537445 -0.43490896  0.3758741  -1.8568311 ]
artist: [-1.0198698   0.95123106  0.49872494 -0.43620515  0.14095953  1.0045712  1.0922406   0.3933396  -0.9733122  -2.6726315 ]
we: [ 0.749994   -0.3359808  -2.2817664  -1.4072689  -0.08516928  0.06589801  0.24936448  0.5603658  -0.60731363  1.4001027 ]
kitchen: [ 1.9809147  -1.1696817  -1.8995901  -0.03436245 -0.82057565 -1.7564831  0.90127283 -0.8367295  -3.01461     0.39563313]
motivates: [-1.6378319   1.0933137  -3.4925394  -0.23310485 -0.9777746  -0.12320134  0.12422848 -0.80487525 -0.5570749  -0.9354017 ]
sleeper: [-1.6157674  -2.6588438   1.2897236  -1.6966282  -0.15583254  0.5473533 -0.32664555 -0.25638485 -0.37578464  0.65686256]
operations: [-0.6159169  -0.31936947  0.602366   -1.8753413  -0.4849519  -1.1464977 -1.1220255   0.7575169   1.4622692   0.32791957]
in: [-1.1317031   1.9027429  -2.7683861  -0.33477902 -4.0719805   2.8854942 -3.537964   -1.0592852  -0.6201668  -0.82018393]
its: [-1.0485286   0.84620976  1.7057956  -1.4314649  -0.21905522  0.56878 -0.61330897  0.48540443  1.6036756  -1.0596213 ]
vibrant: [ 1.3656029  -0.27123195  1.1990914   1.3255558  -0.5450648   1.6525235 -0.5535945   0.47400057  0.3035918   2.1976593 ]
performance: [ 1.6675795  -0.8942209   0.7879939  -0.3234387  -0.33926928  0.5036285  0.79738307  1.6753192   0.25685608 -0.6911583 ]
that: [-0.6333203  -0.14072289 -1.398917    0.9035149   0.57843685 -0.87129647 -2.5621874   0.36574948  1.132348   -1.1657466 ]
alarm: [-0.7909759   1.1950206   1.4093492   0.5407557   0.2757615   0.01521467  0.381164   -1.1059071   1.6779425  -0.62681496]
devouring: [-2.0915148   1.1519055  -0.7831747   0.7070789   0.27724454  1.3150536 -2.4065113   0.62768865 -0.6609059   1.3307048 ]
buyer: [ 0.66779035  0.677024    0.24162592  1.0434073  -0.51506793 -0.79618776  0.14285873 -0.75121963  0.8200969  -1.6002523 ]
give: [ 0.59323704 -0.50010526  1.7080827  -1.2611123   0.2451061  -1.5685015 -1.0522405   1.3985785  -0.68726474 -0.11642732]
mountains: [-0.66699517  0.11815584  0.6550327  -0.37873623 -0.54701734 -0.75163776  1.1346332  -1.1369863   0.5436502   0.4389866 ]
'''
